<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
	
	class Admin_model extends CI_Model{ 
		function __construct(){
			parent::__construct();
		}
		function findAdmminUserByUserAndPassword($username = "", $password = ""){
			$sql = "SELECT `id` FROM `users` ";
			$sql .= "WHERE `username` = ? AND `password` = ? ";
			//$sql .= "AND status = 'activate' AND admin > 0 AND logined = 0;";
			$query = $this->db->query($sql, array($username, $password));
			if($query->num_rows() > 0){
				$row = $query->row_array();
				return $row;
			}
			return null;
		}
	}
?>
